package edu.spec.rxz.week09.class2;


    public class Test {
        public static void main(String[] args) {

            List pets = new ArrayList();

            List sounds1 = new ArrayList();
            sounds1.add("喵喵11");
            sounds1.add("喵喵12");
            sounds1.add("喵喵13");

            List foods1 = new ArrayList();
            Food food11 = new Food("鲫鱼", 8);
            Food food12 = new Food("小鱼", 6);
            Food food13 = new Food("汤泡饭", 2);
            foods1.add(food11);
            foods1.add(food12);
            foods1.add(food13);

            Cat cat1 = new Cat("cat1", sounds1, foods1);

            List sounds2 = new ArrayList();
            sounds2.add("汪汪21");
            sounds2.add("喵喵22");
            sounds2.add("喵喵23");

            List foods2 = new ArrayList();
            Food food21 = new Food("排骨", 20);
            Food food22 = new Food("火腿肠", 6);
            Food food23 = new Food("汤泡饭", 4);
            foods2.add(food21);
            foods2.add(food22);
            foods2.add(food23);
            Dog dog2 = new Dog("dog2", sounds2, foods2);

            pets.add(cat1);
            pets.add(dog2);
            Master tom = new Master(pets);
            for (int i=0; i<tom.getPets().size(); i++){
                IPet pet = (IPet)pets.get(i);
                tom.feed(pet);
            }
        }
    }

